export namespace UIManagerDefines {
    // 跑马灯速度 xxx/秒
    export const MARQUEE_LABEL_SPEED = 200;

    /**
     * 默认预制体路径
     */
    export const DEFAULT_PATH = {
        DIALOG: "common/dialog",
        TIP: "common/tips",
        MARQUEE: "common/marquee",
    }

    /**
     * ui设置属性
     */
    export type PanelOptions = {
        path: string,
        priority?: PANELPRIORITY,       // 层级
        loadedCall?: Function,         // 加载完成回调
        enableCall?: Function,         // 激活回调
        disableCall?: Function,        // 关闭回调
        blockInput?: number,           // 设置mask防止触摸 这里设置mask的透明度
        closeOther?: boolean,           // 是否按照优先级，关闭其他面板 
        //...一些其他属性
    }

    /**
     * 跑马灯设置
     */
    export type MarqueeOptions = {
        content: string,          // 内容
        path?: string,            // 预制体路径
        playTime?: number,        // 播放次数 -1:loop, 0:stop, >0次数 默认为1
        top?: boolean,            // 立即播放，如果有其他跑马灯在执行则立马被中断
        args?: any[]
    }


    /**
     * 弹窗设置
     */
    export type DialogOptions = {
        content: string,         // 内容
        path?: string,
        title?: string,          // 标题
        confirmCall?: Function,  // 确认回调（显示确定按钮 默认
        cancelCall?: Function,   // 取消回调（显示取消按钮 跟确定一起则会同时显示两个按钮，否则只会出现一个
    }

    /**
     * tip提示设置
     */
    export type TipOptions = {
        content: string,         // 内容
        path?: string,           // 预制体路径
    }

    /**
     * ui类型
     */
    export const UITYPE = {
        ALL: 1 << 0,
        PANEL: 1 << 1,
        MARQUEE: 1 << 2,
        DIALOG: 1 << 3,
        TIPS: 1 << 4,
    }

    //界面优先级
    export const enum PANELPRIORITY {
        ZERO = 0,//最底层
        FIRST,
        SECOND,
        THIRD,
        FOUR,

        MARQUEE,
        DIALOG,
        TIPS,
    }

    /**
     * 优先级转换为节点名
     */
    export const PriorityToName = {
        "0": "ui_panel_0",
        "1": "ui_panel_1",
        "2": "ui_panel_2",
        "3": "ui_panel_3",
        "4": "ui_panel_4",
        "5": "ui_marquee",
        "6": "ui_dialog",
        "7": "ui_tips",
    }

    /**
     * UI事件
     */
    export enum UIEvent {
        ON_OPEN_PANEL = "onOpenPanel",
        ON_CLOSE_PANEL = "onClosePanel",
        ON_OPEN_DIALOG = "onOpenDialog",
        ON_CLOSE_DIALOG = "onCloseDialog",
    }
}